﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EffectsVolume : MonoBehaviour
{
    private AudioSource effects;

    private void Awake()
    {
        effects = this.GetComponent<AudioSource>();
        effects.playOnAwake = false;
        effects.loop = false;
    }
    private void OnEnable()
    {
        //音效音量本地存储、读取
        effects.volume = PlayerPrefs.GetFloat("EffectsVolume");
        effects.Play();
    }

    private void OnDisable()
    {
        effects.Stop();
    }
}
